Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ebs loss scenario #692

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

jtydlack
Copy link
Collaborator

@jtydlack jtydlack commented Sep 6, 2024

  • Added scenario config
  • Added new folder containing scenarion scripts
  • Added scenario in run_kraken.py and kraken config

Resolves #678

@jtydlack jtydlack force-pushed the detach_ebs_volumes branch 2 times, most recently from 6da4afc to 0fc21a1 Compare October 1, 2024 09:14
@jtydlack jtydlack marked this pull request as ready for review October 2, 2024 09:25
@@ -46,6 +46,8 @@ kraken:
- scenarios/kube/service_hijacking.yaml
- syn_flood:
- scenarios/kube/syn_flood.yaml
- aws:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lets try to put a clearer name of the scenario here, think this current name can get confusing

@@ -0,0 +1,9 @@
aws_access_key_id: # only if system-wide credentials are not
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We might want to add a reference around setting up aws secrets similar to node scenarios: https://github.com/krkn-chaos/krkn/blob/main/docs/node_scenarios.md#aws. This way they do not get exposed in the stdout. Thoughts?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

agree on this, we currently configure aws connection just based on enviornment variables we should see if we can do the same set up here

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

...and maybe drop the ebs from the name to make it CSP-agnostic?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the aws cli is configured it should take those credentials if other are not specified so I will put the reference how to setup the credentials in documentation and will remove the option to put there different credentials

@@ -0,0 +1,9 @@
aws_access_key_id: # only if system-wide credentials are not
aws_secret_access_key: # configured or using different credentials
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We might want to introduce a cloud_type variable which is set to aws in this case as we will be adding support for Azure and GCP as well for this scenario. For example: https://github.com/krkn-chaos/krkn/blob/main/scenarios/openshift/aws_node_scenarios.yml#L10

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The goal is to use the same config and load things differently based on the cloud_type.

@pablomh
Copy link
Contributor

pablomh commented Oct 24, 2024

Is there any reason why this functionality shouldn't be implemented as a new scenario of aws_node_scenarios?

@chaitanyaenr
Copy link
Collaborator

Is there any reason why this functionality shouldn't be implemented as a new scenario of aws_node_scenarios?

Agree with @pablomh that we can make it as an additional action in the node-scenarios - https://github.com/krkn-chaos/krkn/blob/main/scenarios/openshift/aws_node_scenarios.yml where the parameters are similar for aws, gcp, azure - node name to target, volume id etc and we run the detach logic based on cloud_provider set ( aws, gcp etc. )

- Added scenario config
- Added new folder containing scenarion scripts
- Added scenario in run_kraken.py and kraken config

Resolves krkn-chaos#678

Signed-off-by: jtydlack <[email protected]>

# Conflicts:
#	run_kraken.py
- Added excetions
- Supporting multiple regions
- Volume selection by volume id or node/instance id
- Aws access key id and aws secret access key not needed if system
wide credentials configured

Signed-off-by: jtydlack <[email protected]>
@@ -36,6 +36,16 @@ def helper_node_stop_start_scenario(self, instance_kill_count, node, timeout):
self.helper_node_start_scenario(instance_kill_count, node, timeout)
logging.info("helper_node_stop_start_scenario has been successfully injected!")

# Node scenario to detach and attach the disk
def disk_detach_attach_scenario(self, instance_kill_count, node, timeout, duration):
logging.info("Starting node_stop_start_scenario injection")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's be sure the logging information here matches the action we are doing, should be something like "Starting to detach disk"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Scenario to detach EBS volumes
4 participants